import 'package:flutter_test/flutter_test.dart';
import 'package:app_document/app_document.dart';
import 'package:app_document/app_document_platform_interface.dart';
import 'package:app_document/app_document_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAppDocumentPlatform
    with MockPlatformInterfaceMixin
    implements AppDocumentPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AppDocumentPlatform initialPlatform = AppDocumentPlatform.instance;

  test('$MethodChannelAppDocument is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAppDocument>());
  });

  test('getPlatformVersion', () async {
    AppDocument appDocumentPlugin = AppDocument();
    MockAppDocumentPlatform fakePlatform = MockAppDocumentPlatform();
    AppDocumentPlatform.instance = fakePlatform;

    expect(await appDocumentPlugin.getPlatformVersion(), '42');
  });
}
